#ifndef MYPLAIMTEXTEDIT_H
#define MYPLAIMTEXTEDIT_H

#include <QPlainTextEdit>
#include <QTimer>

class MyPlaimTextEdit : public QPlainTextEdit
{
    Q_OBJECT
public:
    MyPlaimTextEdit(QWidget* parent = nullptr);


private:
    void initTimer();

private:

    bool onOperation = false;
    bool isPress = true;
    bool isAuto = true;

    QTimer timer;

    // QWidget interface
protected:
    virtual void mouseMoveEvent(QMouseEvent *event) override;
    virtual void wheelEvent(QWheelEvent *event) override;

    virtual void mousePressEvent(QMouseEvent *event) override;
    virtual void mouseReleaseEvent(QMouseEvent *event) override;


    // QObject interface
public:
    virtual bool eventFilter(QObject *watched, QEvent *event) override;
};

#endif // MYPLAIMTEXTEDIT_H
